package com.dhcc.bpm.modules.scf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.scf.dto.ScfInvoiceInfoDTO;
import com.dhcc.bpm.modules.scf.entity.ScfInvoiceInfo;
import com.dhcc.bpm.modules.scf.entity.SelectEntity.InvoiceInfoPaymentInfoRef;
import com.dhcc.bpm.modules.scf.entity.SelectEntity.RecyclingInByPayment;
import com.dhcc.bpm.modules.scf.vo.ScfInvoiceInfoVO.ScfGetInvoiceDetailsVO;
import com.dhcc.bpm.modules.scf.vo.ScfInvoiceInfoVO.ScfGetInvoiceListVO;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 发票信息-Mapper接口
 */
@Repository
public interface ScfInvoiceInfoMapper extends BaseMapper<ScfInvoiceInfo> {
    /**
     * 自定义分页
     *
     * @param page
     * @param scfInvoiceInfo
     * @return
     */
    List<ScfGetInvoiceListVO> selectScfInvoiceInfoPage(IPage<ScfGetInvoiceListVO> page, ScfInvoiceInfoDTO scfInvoiceInfo);

    /**
     * 查询发票详情信息
     *
     * @param rowId
     * @return
     */
    ScfGetInvoiceDetailsVO getDeatil(String rowId);

    /**
     * 查询支付回单对应的发票RowId
     *
     * @param paymentNum
     * @return
     */
    String selectRowIdByPaymentNum(String paymentNum);

    /**
     * 查询发票号码对应的rowId
     *
     * @param invoiceNum
     * @return
     */
    String selectRowIdByInvoiceNum(String invoiceNum);

    boolean deleteByIds(String[] ids);


    List<ScfGetInvoiceListVO> queryByScfGetInvoiceListVOPaymentNum(String paymentNum);

    int saveInvoiceInfoPaymentInfoRef(InvoiceInfoPaymentInfoRef invoiceInfoPaymentInfoRef);

    int saveInvoiceInfoPaymentInfoRefNoPaymentRowId(InvoiceInfoPaymentInfoRef invoiceInfoPaymentInfoRef);


    List<String> selectRowIdByInvoiceRowId(String rowId);

    int removeInviocePaymentByRowId(String rowId);

    int deleteByInvoiceRowId(String rowId);
    List<ScfGetInvoiceListVO> queryByScfGetInvoiceListVOByPaymentRowId(String paymentRowId ,String paymentNum);
}


